<?php
require('db.php');
$tabel = $_GET['tabel'];
$vak = $_GET['vak'];

$data=json_decode(file_get_contents('php://input'));
$result = mysql_query("DELETE FROM $tabel WHERE vakID=(SELECT id FROM vak WHERE naam='$vak') AND competentieID='$data->id'");

?>